
from time import time


files=['m1_sorted.txt','m2_reverse.txt','m3_shuffle.txt']
for filename in files:
    start=time()
    x=[]
    file=open(filename)
    for i in file.readlines():
        
        
        i=i.replace("\n","")   
        i=int(i)
        x.append(i)      
    isSwapped=True
    j=len(x)-1
    while isSwapped:
        isSwapped=False
        for i in range(0,j):
            if x[i]>x[i+1]:
                x[i],x[i+1]=x[i+1],x[i]
                isSwapped=True
        j-=1
    end=time()
 
    print(filename,int(end-start),("milisecond"))
